

#ifndef XOTA_DESC_H__
#define XOTA_DESC_H__

#include <stdint.h>

#define OTA_DESC_APP_OTA_INVALID   0x0000   // for cancel OTA 
#define OTA_DESC_APP_INVALID       0xFFFF 
#define OTA_DESC_APP_VALID         0x0001   // Application valid
#define OTA_DESC_APP_OTA_REQ       0xB00A   // OTA requires
#define OTA_DESC_APP_OTA_COPY      0xC092   // Copy requires

typedef struct
{
    uint16_t crc;           // crc of content
    uint16_t length;        // length of content

    // for APPLICATION
    struct
    {
        uint32_t state;  // application status
        uint32_t size;
        uint32_t crc32;        // crc32 for application
        uint32_t version;      // application version
    }APP;

    // for OTA 
    struct 
    {
        uint32_t req; //require 
        uint32_t size; // size of firmware
        uint32_t src_addr; // address of new firmware 
        uint32_t dest_addr; // address of new firmware destination
        uint32_t option_data; // option data address 
    }OTA;
}ota_desc_t;

/* 
option data refer to OTA init data type 
typedef struct
{

}ota_option_data_t; 
*/

#endif
